Fermat's little theorem explained